package testingtool.fs_freespace;

import java.io.File;

public class GetDiskSpaceReport {
	
	public static void main(String[] args) {
		
		File file = new File("c:/");
		
		System.out.println("total space: " + file.getTotalSpace()/1024/1024/1024 + "MB");
		System.out.println("free space: " + file.getFreeSpace()/1024/1024/1024 + "MB");
		System.out.println("usable space: " + file.getUsableSpace()/1024/1024/1024 + "MB");
		
		double percentage = Double.valueOf(file.getUsableSpace())/Double.valueOf(file.getTotalSpace());
		
		System.out.println("usable space percentage: " + percentage);
		
	}

}
